package com.crealth.model;

import java.io.Serializable;

import com.alibaba.fastjson.JSONObject;
import com.crealth.utils.Utils;

public class SipConfigModel implements Serializable {
	private static final long serialVersionUID = 1848402L;
	
	private int companyID;  // 公司id
	private String cityName;  // 所在城市
	private String sipServer;
	private String sipAccount;
	private String sipPwd;
	private String inSipServer;
	private String inSipAccount;
	private String inSipPwd;
	
	public int getCompanyID() {
		return companyID;
	}
	public void setCompanyID(int companyID) {
		this.companyID = companyID;
	}
	public String getCityName() {
		return cityName;
	}
	public void setCityName(String cityName) {
		this.cityName = cityName;
	}
	public String getSipServer() {
		return sipServer;
	}
	public void setSipServer(String sipServer) {
		this.sipServer = sipServer;
	}
	public String getSipAccount() {
		return sipAccount;
	}
	public void setSipAccount(String sipAccount) {
		this.sipAccount = sipAccount;
	}
	public String getSipPwd() {
		return sipPwd;
	}
	public void setSipPwd(String sipPwd) {
		this.sipPwd = sipPwd;
	}
	public String getInSipServer() {
		return inSipServer;
	}
	public void setInSipServer(String inSipServer) {
		this.inSipServer = inSipServer;
	}
	public String getInSipAccount() {
		return inSipAccount;
	}
	public void setInSipAccount(String inSipAccount) {
		this.inSipAccount = inSipAccount;
	}
	public String getInSipPwd() {
		return inSipPwd;
	}
	public void setInSipPwd(String inSipPwd) {
		this.inSipPwd = inSipPwd;
	}
	
	public JSONObject toJSONObject(JSONObject resJson) {
		if (resJson == null) {
			resJson = new JSONObject();
		}
		resJson.put("companyID", companyID);
		resJson.put("cityName", cityName);
		resJson.put("sipServer", sipServer);
		resJson.put("sipAccount", sipAccount);
		resJson.put("sipPwd", sipPwd);
		resJson.put("inSipServer", inSipServer);
		resJson.put("inSipAccount", inSipAccount);
		resJson.put("inSipPwd", inSipPwd);
		
		return resJson;
	}
	
	public void parseFromJson(JSONObject json) {
		sipServer = Utils.getJsonString(json, "sipIP");
		sipAccount = Utils.getJsonString(json, "sipAct");
		sipPwd = Utils.getJsonString(json, "sipPwd");
		inSipServer = Utils.getJsonString(json, "sipIncomeIP");
		inSipAccount = Utils.getJsonString(json, "sipIncomeAct");
		inSipPwd = Utils.getJsonString(json, "sipIncomePwd");
		
	}
	
	
}
